import { useDialogStore } from '@/stores/dialog'
import { getLayerTreeObject } from '@/utils/getInoByVedio'
import { useAirCityStore } from '@/stores/aircity'

let ele: any
let lastEvent: PointerEvent
const OnReady = async () => {
    __g.settings.setCampassVisible(false)
    __g.misc.setMainUIVisibility(false)

    const dialogStore = useDialogStore()
    const AirCityStore = useAirCityStore()
    AirCityStore.SetIsOnReady(true)

    /**
     * 获取图层树
     */
    await getLayerTreeObject()

    ele = document.querySelector('#player video')
    if (ele) {
        ele.onclick = (e: PointerEvent) => {
            if (e && e.stopPropagation) {
                e.stopPropagation()
            }
            lastEvent = e
            dialogStore.setLastEvent(lastEvent)
        }
    }
}
export default OnReady
